<?php
    class Controller_MyTwitter extends Controller_Twitter {
        public function action_getTimeline($page){
		$twitter = $this->check_for_login();
		$twitter->decode_json = FALSE;

		$json = json_decode($twitter->get('statuses/home_timeline', array('count' => '10', 'page' => $page)), TRUE);

		$better_json = array();
		$json_count = count($json);
		for($i = 0; $i < $json_count; $i++)
		{
			$c = $json[$i];
			$better_json['results'][] = array(
				'id'					=> $c['id'],
				'from_user_id'			=> $c['user']['id'],
				'from_user'				=> $c['user']['screen_name'],
				'profile_image_url'		=> $c['user']['profile_image_url'],
				'created_at'			=> $c['created_at'],
				'to_user_id'			=> $c['in_reply_to_user_id'],
				'text'					=> $c['text'],
				'geo'					=> $c['geo'],
				'source'				=> $c['source'],
			);
		}

		print_r($better_json);
        }
    }
?>
